<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>订单支付</title>
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/midi/css/ddzf.css"/>
    <!--<script src="js/public.js"></script>-->
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/midi/css/swiper-3.4.2.min.css"/>
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/midi/css/initialize.css"/>
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/midi/css/public.css"/>
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/midi/css/validform.css"/>
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/midi/css/jquery-ui.min.css"/>
    <script src="__PUBLIC__/midi/js/jquery-2.2.3 (1).js"></script>
    <script src="__PUBLIC__/midi/js/public.js"></script>
    <script src="__PUBLIC__/midi/js/swiper-3.4.2.jquery.min.js"></script>
    <script src="__PUBLIC__/midi/js/validform.js"></script>
    <script src="__PUBLIC__/midi/js/jquery-ui.min.js"></script>
    <script src="__PUBLIC__/midi/js/cart.js"></script>
    <script src="__PUBLIC__/midi/js/province.js"></script>
</head>
<body>
<!--头部导航栏开始-->
<include file="Public/header" />
<!--头部导航栏结束-->
<div class="shipin-datails">
    <div class="con">
        <div class="inner">
            <i></i>
            <span>当前位置：首页 &gt; 曲谱教程 &gt; 商品详情 &gt; 订单支付</span>
        </div>
    </div>
</div>
<div class="wiezhi">
    <div class="con">
        <span>当前位置：首页&gt; 曲谱教程&gt; 商品详情&gt;订单支付</span>
    </div>
</div>

<!--订单支付主要内容-->
<div class="ddzf">
    <div class="con">
        <div class="inner">
            <div class="tjdz">
                <h2>选择收货地址</h2>
                <ul>
                    <foreach name="address_list" item="vo">
                        <li data-id="{$vo['address_id']}" class="address <if condition="$vo['address_default'] eq 1"> active </if> ">
                            <a>
                                <p class="sjr">{$vo['address_username']}</p>
                                <p class="sjr-address">{$vo['address_address']}</p>
                                <p class="sjr-phone">{$vo['address_userphone']}</p>
                            </a>
                        </li>
                    </foreach>
                    <li class="newaddress">
                        <div class="jia"><img src="__PUBLIC__/midi/img/tianjiatupian.png"/></div>
                        <p>添加新地址</p>
                    </li>
                    <div style="clear: both;"></div>
                </ul>
            </div>
            <div class="goods-info">
                <p>确认商品信息</p>
                <table>
                    <tr>
                        <td></td>
                        <td class="td">单价</td>
                        <td class="td">数量</td>
                        <td class="td">实价</td>
                    </tr>
                    <foreach name="sure_goods" item="vo">
                        <tr>
                            <td >
                                <img src="__ROOT__{$vo['goods_pic']}"/>
                                <span>{$vo['goods_name']}</span>
                            </td>
                            <td class="td " id="danjia1">&yen;<span>{$vo['goods_price']}</span></td>
                            <td class="td " id="shuliang1">&times;<span>{$vo['goods_num']}</span></td>
                            <td class="td " id="shijia1">&yen;<span>{$vo['prices']}</span></td>
                        </tr>
                    </foreach>
                </table>
            </div>
            <div class="word">
                <form>
                    <label>给卖家留言</label>
                    <input type="text" />
                </form>
                <p class="total">合计:&yen;<span>{$total_prices}</span></p>
                <!--<p class="fare">运费:&yen;<span>12.00</span></p>-->
                <div style="clear: both;"></div>
            </div>
            <p class="order-total" >订单总额&yen;<span>{$total_prices}</span></p>
            <div style="clear: both;"></div>
            <form method="post" action="{:U('Order/payDoing')}">
                <div class="payment">
                    <p>支付方式</p>
                        <input type="hidden" name="order_id" value="{$order_id}">
                        <input type="hidden" name="order_details" value="{$sure_id_str}">
                        <input type="hidden" name="order_address" value="{$order_address}">
                        <input type="hidden" name="toType" value="{$toType}">
                        <div class="weixin">
                            <input type="radio" value="2" name="pay_type" checked="checked"/>
                            <img src="__PUBLIC__/midi/img/zhifu_weixin.png" />
                            <span>微信支付</span>
                        </div>
                        <div class="zhifubao">
                            <input type="radio" value="1" name="pay_type"/>
                            <img src="__PUBLIC__/midi/img/zhifu_zhifubao.png" />
                            <span>支付宝支付</span>
                        </div>
                        <div style="clear: both;"></div>
                </div>
                <!--<a class="pay">订单确认</a>-->
                <input type="submit" value="订单确认" class="pay">
            </form>
        </div>
    </div>
</div>
<!--订单支付主要内容结束-->
<!--新增收货地址弹窗-->
<div class="add-overlay">
    <div class="overlay-content">
        <div class="title">
            <span class="add">添加收货地址</span>
            <span class="close">关闭</span>
        </div>
        <div class="overlay-main">
            <form class="registerform" method="post" action="{:U('Order/addAddress')}">
                <div>
                    <label>收货人姓名</label>
                    <input type="input" name="address_username" placeholder="收货人姓名" datatype="*" nullmsg="请输入收货人姓名"/>
                </div>
                <div>
                    <label>收货人地址</label>
                    <span>
                        <select  nullmsg="请选择省份" name="province3"></select>
                        <select  nullmsg="请选择城市" name="city3"></select>
                        <select  nullmsg="请选择市区" name="area3"></select>
                    </span>
                </div>
                <div>
                    <label></label>
                    <input type="input" name="address_detail" placeholder="街道地址及门牌号" datatype="*" nullmsg="请输入具体地址"/>
                </div>
                <div>
                    <label>邮政编码</label>
                    <input type="input" name="address_zipcode" placeholder="邮政编码" datatype="p" errormsg="请输入正确的邮政编码"/>
                </div>
                <div>
                    <label>联系电话</label>
                    <input type="input" name="address_userphone" placeholder="手机号" datatype="m" errormsg="请输入正确的手机号码"/>
                </div>
                <div>
                    <label></label>
                    <input type="submit" placeholder="提交" class="submit"/>
                    <input type="reset" value="取消" class="cancel"/>
                </div>
            </form>
        </div>
    </div>
</div>
<!--新增收货地址弹窗结束-->
<script>
    new PCAS("province3","city3","area3");
    $(function(){
        $(".address").on("click",function(){
            $(".address").removeClass("active");
            if($(this).hasClass("active")){
                $(this).removeClass("active");

            }else{
                $(this).addClass("active");
            }
            $('input[name="order_address"]').val($(this).attr('data-id'));
        });
        $(".newaddress").on("click",function(){
            $(".add-overlay").show();
            $("body").css({
                'overflow':'hidden'
            });
            $(".add-overlay").css({
                'overflow-x':'hidden',
                'overflow-y':'auto'
            })
        })
        $(".close").on("click",function(){
            $(".add-overlay").hide();
            $("body").css({
                'overflow':'auto'
            })
        });
        $.Tipmsg.tit="错误提示";
        var demo=$(".registerform").Validform({
            beforeSubmit:function(curform){
                $(":submit",this).attr("disabled","disabled");
            },
        });
        demo.tipmsg.s="请输入信息";
        function pricenum(){
            var totalprice = 0;
            for(var i = 1;i<3;i++){
                var shuliang = parseFloat($("#shuliang"+i).find("span").html());
                var danjia = parseFloat($("#danjia"+i).find("span").html());
                var smalltotal = shuliang*danjia;
                totalprice = totalprice+smalltotal;
                var shijia = $("#shijia"+i).find("span");
                shijia.html(smalltotal.toFixed(2));
            }
            $(".total span").html(totalprice.toFixed(2));
            $(".order-total span").html(totalprice.toFixed(2));
        }
//        pricenum();
    })
</script>
</body>
</html>
